﻿using BBCore.Application.Admins;
using BBCore.Core.Models.Admins;
using BBCore.Infrastructure.Helps;
using BootstrapBlazor.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace BBCore.Application.Service
{
    public class LookupService : ILookupService
    {
        private readonly IAdminService _adminService;   
        public LookupService(IAdminService IAdminService)
        {
            _adminService = IAdminService;
        }
        /// <summary>
        /// 根据不同的key得到不同的selectitem对象
        /// </summary>
        /// <param name="key">BBCore_Constant类的常数那里</param>
        /// <returns></returns>
        public IEnumerable<SelectedItem>? GetItemsByKey(string? key) => GetItemsByKey(key, null);    
        public IEnumerable<SelectedItem>? GetItemsByKey(string? key, object? data)
        {
        if (key == BBCore_Constant.role_selectItems)
        {
            return _adminService.role_SelectedItems(false);
        }
        return null;
    }
    }
}
